<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<style>
  .da{
      width: 300px;
      height: 300px;
      border: 4px black solid;
  }
  .a,.b{
      width: 80px;
      height: 80px;
  }
  .a{
      background: red;
      float: left;
      margin: 10px;
  }
  .b{
      background: blue;
      float: right;
      margin: 10px;
  }
</style>

<body>
    <div class="da">
        <div class="a"></div>
        <div class="b"></div>
    </div>
</body>
</html>